#ifndef QIPADDRESSSPINBOX_H
#define QIPADDRESSSPINBOX_H

#include "shared_global.h"

#include <QAbstractSpinBox>

class SHARED_SHARED_EXPORT QIpAddressSpinBox : public QAbstractSpinBox
{
    Q_OBJECT
    Q_PROPERTY(int ipAddress READ address WRITE setAddress USER true)
public:
    QIpAddressSpinBox(QWidget *parent = 0);
    ~QIpAddressSpinBox();

    int address();
    void setAddress(int address);
protected:
    void    update_value();
protected:
    void     keyPressEvent(QKeyEvent *event);
protected slots:
    void    edit_text_changed(const QString &t);
signals:
    void    address_changed(int address);
protected:
    int     m_current_index;
    int     m_ipAddress;

};

#endif // QIPADDRESSSPINBOX_H
